{include file=header.html}
<div id="main" class="w-full">
    <div id="page-sdemand" class="w mb20 mt10 clearfix">
        <div class="col-sub">
            <div class="title">{$lang.acategory}</div>
            <ul class="content mb10">
                <!-- {foreach from=$acategories item=acategory} -->
                <li><a href="{url app=sdemand&cate_id=$acategory.cate_id}">{$acategory.cate_name|escape}</a></li>
                <!-- {/foreach} -->
            </ul>
            <div class="title">{$lang.new_article}</div>
            <ul class="content">
                <!-- {foreach from=$new_articles item=new_article} -->
                <li><a  href="{url app=sdemand&act=view&id=$new_article.id}">{$new_article.title|escape}</a></li>
                <!-- {foreachelse} -->
                <li>{$lang.no_new_article}</li>
                <!-- {/foreach} -->
            </ul>
        </div>

        <div class="col-main">
            {include file=curlocal.html}
            <div class="sdemand-form">
                <form method="get">
                    <input type="hidden" name="app" value="sdemand" />
                    {$lang.title}:<input class="queryInput" type="text" name="title" value="{$query.title|escape}" />&nbsp;&nbsp;
                    {$lang.select_type}:
                    <select class="querySelect" name="type">
                        <option value="">{$lang.select_pls}</option>
                        {html_options options=$type selected=$smarty.get.type}
                    </select>
                    &nbsp;&nbsp;
                    <input type="submit" class="btn" value="{$lang.query}" />
                    <a class="btn-fabu" href="{url app=supply_demand&act=add}" target="_blank"><i></i>{$lang.pulish_info}</a>
                </form>
            </div>
            <div class="sdemand-list">
                <!--{if $infos}-->
                <table class="bordered">
                    <thead>
                        <tr>
                            <th>{$lang.title}</th>        
                            <th>{$lang.price}</th>
                            <th>{$lang.name}</th>
                            <th>{$lang.phone}</th>
                            <th>{$lang.region}</th>
                            <th>{$lang.add_time}</th>
                        </tr>
                    </thead>
                    <tbody>
                        <!-- {foreach from=$infos item=info} -->
                        <tr>
                            <td><a href="index.php?app=sdemand&type={$info.type}" target="_blank" style="color:red">{if $info.type eq 1}[{$lang.supply}]{else}[{$lang.demand}]{/if}</a> <a href="{url app=sdemand&act=view&id=$info.id}" target="_blank">{$info.title|escape|truncate:20}</a></td>        
                            <td>{if $info.price neq 0}{$info.price|price}{elseif $info.price_from neq 0 and $info.price_to neq 0}{$info.price_from|price} - {$info.price_to|price}{else}{$lang.asktoface}{/if}</td>
                            <td>{$info.name}</td>
                            <td>{$info.phone}</td>
                            <td>{$info.region_name}</td>
                            <td>{$info.add_time|date:Y-m-d H:i}</td>
                        </tr>     
                        <!-- {/foreach} -->
                    </tbody>
                </table>
                <!--{else}-->
                <div class="goods-empty mb10">{$lang.not_found}</div>
                <!--{/if}-->
            </div>
        </div>
    </div>
</div>
{include file=footer.html}